import {
	msg
} from "@/utils/msg.ts"
import {
	kingdeeLogin,
} from "@/network/apis.ts";
/* 登录金蝶 */
export default async function(code) {
	if (uni.getStorageSync("kdservice-sessionid")) return
	return new Promise(async (resove, reject) => {
		const {
			data: saveRes
		} = await kingdeeLogin({
			acctID: "61c743844107a8",
			username: "demo",
			password: "111111",
			lcid: 2052,
		});

		if (saveRes.LoginResultType === 1) {
			uni.setStorageSync("kdservice-sessionid", saveRes.KDSVCSessionId);
			resove(true)
		} else {
			reject(false)
			msg(saveRes.Message);

		}
	})

}